package spring.impl;

import spring.inters.HelloApi;
import spring.model.Printer;

public abstract class HelloImpl5 implements HelloApi {
    private Printer printer;

    @Override
    public void sayHello() {
        printer.print("setter---");
        createPrototypePrinter().print("Prototype---");

    }

    public abstract Printer createPrototypePrinter();

    public void setPrinter(Printer printer) {
        this.printer = printer;
    }

    public Printer createSingletonPrinter() {
        System.out.println("createSingletonPrinter>>>");
        return new Printer();
    }
}
